<template>
  <div>
    <h1>当前计数为： {{ count }}</h1>
    <button @click="increment">+1</button>
  </div>
</template>

<script>
import { ref, getCurrentInstance } from 'vue'
export default {
  data() {
    return {
      count: 100
    }
  },
  created() {
    console.log('created', this.count)
    console.log('created', this.$axios)
  },
  setup() {
    const instance = getCurrentInstance()
    const count = ref(100)
    const increment = () => {
      return count.value++
    }
    console.log('setup', this)
    console.log('setup', instance.appContext.config.globalProperties.$axios)

    return {
      count,
      increment
    }
  }
}
</script>

<style lang="scss" scoped></style>
